import React, { Component } from 'react';

import propTypes from 'prop-types'

class XiaojiejieItem extends Component {
	constructor(props) {
		super(props)
		this.state = {}
    }
    
    
    shouldComponentUpdate (nextProps,nextState) {
      
        if (nextProps.content !== this.props.content) {
            
            return true

        } else {
            
          return  false
        }
    }

    render () {
        console.log('child-render');
		return <div onClick={this.handleClick}>{this.props.content}</div>
	}
    handleClick = () => {
       this.props.delItem(this.props.index)
        //console.log(this.props.index, '111')

    }
}
XiaojiejieItem.propTypes = {
	content: propTypes.string.isRequired,
	delItem: propTypes.func,
	index: propTypes.number,
}
XiaojiejieItem.defaultProps = {

}

export default XiaojiejieItem;